package cn.iocoder.yudao.module.system.dal.mysql.partner;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.partner.PartnerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.partner.vo.*;
import org.apache.ibatis.annotations.Select;

/**
 * 合伙人 Mapper
 *
 * @author 万民匠心
 */
@Mapper
public interface PartnerMapper extends BaseMapperX<PartnerDO> {

    default PageResult<PartnerDO> selectPage(PartnerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PartnerDO>()
                .likeIfPresent(PartnerDO::getName, reqVO.getName())
                .eqIfPresent(PartnerDO::getAccount, reqVO.getAccount())
                .eqIfPresent(PartnerDO::getPassword, reqVO.getPassword())
                .eqIfPresent(PartnerDO::getPhone, reqVO.getPhone())
                .eqIfPresent(PartnerDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(PartnerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PartnerDO::getId));
    }


}